$(function () {
  //柱状图
  var le_bar = new Echarts("bar", document.getElementById("chart1"));
  //饼状图
  var le_pie = new Echarts("pie", document.getElementById("chart2"));

  le_bar.setOption({
    name: "人数",
    data: [
      {
        name: "一月",
        value: 1000
      },
      {
        name: "二月",
        value: 2000
      },
      {
        name: "三月",
        value: 3000
      },
      {
        name: "四月",
        value: 4000
      },
      {
        name: "五月",
        value: 5000
      }
    ],
    otherOption: {
      title: {
        text: "2017注册人数"
      }
    }
  });
  le_pie.setOption({
    name: "品牌",
    data: [
      { value: 1048, name: "阿迪王" },
      { value: 735, name: "李宁" },
      { value: 580, name: "耐克" },
      { value: 484, name: "回力" },
      { value: 300, name: "新百伦" }
    ],
    otherOption: {
      title: {
        text: "热门品牌销售",
        subtext: "2017年6月17日",
        left: "center"
      }
    }
  });
});
